UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7feyT7GB1aFQApVmcAZ/Shy+/o8a/1lUm2FD1LGScpE='
WHERE
key_id = '22015ba9260d8fd9304de00b1acd368681f056b87b2e194fd4369a32a57dc6b6'
AND (
token = '7feyT7GB1aFQApVmcAZ/Shy+/o8a/1lUm2FD1LGScpE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)