UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fOVEDT5Fpb1mqECic5EDBwNHPSU9mz6XPk035lms5Xs='
WHERE
key_id = 'b96d3bf28916ea8f4370e92beea76265c844c294814c946f66d5c23b5b5338ce'
AND (
token = 'fOVEDT5Fpb1mqECic5EDBwNHPSU9mz6XPk035lms5Xs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)