UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f1p0rLNpNl86Fw2NkEu94Q+aURGSg/kTalalepX/35g='
WHERE
key_id = '275fcd5f227ca4af94105d80240857e0ff9b07b4e358a48ed0c2c4cb339dd99d'
AND (
token = 'f1p0rLNpNl86Fw2NkEu94Q+aURGSg/kTalalepX/35g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)