UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oNERAl8KmKafw8NH+QxGWN2LXavPjAzzz2H3L7Ezx7M='
WHERE
key_id = 'd7dc0ea1bf17579739ef65400fa561d43e5fba78f2f3b8f05f1ac0bae4811925'
AND (
token = 'oNERAl8KmKafw8NH+QxGWN2LXavPjAzzz2H3L7Ezx7M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)