UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KpQ2H4IfyLeXi7KVU9eCBW2ovidF1rNpg3MdlPH9vGU='
WHERE
key_id = '260233f495b19ddee16f18cb1ba3f4186956b2f8edc2c5ab5091bc89a5c7d1a7'
AND (
token = 'KpQ2H4IfyLeXi7KVU9eCBW2ovidF1rNpg3MdlPH9vGU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)