UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MUvxP+J6XyX8n395d9I+a/F5RYddjUjMHS8edJV3VuI='
WHERE
key_id = 'a94199b63abc4ab8591190c43ee44f1923304dfe5a67cb445bd7a431e1b19501'
AND (
token = 'MUvxP+J6XyX8n395d9I+a/F5RYddjUjMHS8edJV3VuI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)