UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x+UWO00OOpeuoeyV99CZ0eHxq9OgYwW274+E+oxeByQ='
WHERE
key_id = '9a2394556ff2cc04124249734dc573284c673588a6844990222f0306b9b2348b'
AND (
token = 'x+UWO00OOpeuoeyV99CZ0eHxq9OgYwW274+E+oxeByQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)