UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8eDZrFe0/cybVbz4gyB9XvYO4ZgsYsMDjyE646+4zMg='
WHERE
key_id = '2ae7caa04906a4429d4f1de39a8ce0aeb99594994baf5edf236a73ff310324d3'
AND (
token = '8eDZrFe0/cybVbz4gyB9XvYO4ZgsYsMDjyE646+4zMg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)