UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YryX4EUaqooVbn7fS2tYKpIgCROkExXthGjdk7uOQ9U='
WHERE
key_id = '64a9efc8d29fc6602923964897bd0b3601f83419c99c2ca447a2cbaa5657e44e'
AND (
token = 'YryX4EUaqooVbn7fS2tYKpIgCROkExXthGjdk7uOQ9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)