UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'njGo9lijp0yKjR28pM/n6NTpEEpIwrF3qTtGbJBDm/0='
WHERE
key_id = '8077feae766aad0cc2ff788796a7b0e021bbc8a6d93c4b3eac6b0b9cb6a0203c'
AND (
token = 'njGo9lijp0yKjR28pM/n6NTpEEpIwrF3qTtGbJBDm/0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)