UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AaesXCAmNKUyQdZyXMZb/IDh2rYfMW7gxRiREvilP1s='
WHERE
key_id = '404faf0b18b19255ec01502ce951df2a9b42b64f6ca70a1a90fdd1bd3ecb8d6a'
AND (
token = 'AaesXCAmNKUyQdZyXMZb/IDh2rYfMW7gxRiREvilP1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)