UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fsQOksK/PpqdWTMS7/FAzUR3uxpOFrkGMr6d/4bF0S4='
WHERE
key_id = 'b941ee195987e12e4b959aec5ee5d1f5851401aa3e5bfd86a574721dc72ba925'
AND (
token = 'fsQOksK/PpqdWTMS7/FAzUR3uxpOFrkGMr6d/4bF0S4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)