UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UaygWaMbR+DQgILtAZ0TpqyzbBDQFVeX9kF5d6qY62M='
WHERE
key_id = 'acd5105102f28b930014c463b88d1c83413d1508e8f1298706d313acead61dda'
AND (
token = 'UaygWaMbR+DQgILtAZ0TpqyzbBDQFVeX9kF5d6qY62M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)