UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E52qkveCtNo2QLpL2X/bexAQ8933dWeUOP2iHf9vLGQ='
WHERE
key_id = '76fbff4ea89d6cb52567dd08feffc856312e51107bbdb2d30b01f4dcf8e2c2b8'
AND (
token = 'E52qkveCtNo2QLpL2X/bexAQ8933dWeUOP2iHf9vLGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)