UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nbrLsy59z9EQ0/ajUUJsoD0lUONTLX60UGywvqP1qZQ='
WHERE
key_id = 'ccc42156dbe27ebdd90afc87b7e14eea8bc19bc71e76c411db9cc90e97703a97'
AND (
token = 'nbrLsy59z9EQ0/ajUUJsoD0lUONTLX60UGywvqP1qZQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)