UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gE2H2MjWONNC7Jo3BXOPDUbWq2NkT8QxRezDpZZCKc4='
WHERE
key_id = '4f3b78d85f4eb8fdab7ad01a94c0905b020be53c3b083433e15fbee61e114cc3'
AND (
token = 'gE2H2MjWONNC7Jo3BXOPDUbWq2NkT8QxRezDpZZCKc4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)