UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F1ewIvAA/zjPmXrdYbPL5KjXtxxE8wWfLJrbVTFrwe0='
WHERE
key_id = 'ae949a9beb4e8317fd2ab7d856fd578c037d7de28b6ad68c6467e5986e84662a'
AND (
token = 'F1ewIvAA/zjPmXrdYbPL5KjXtxxE8wWfLJrbVTFrwe0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)