UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VfCHziQS89KQ9ypPRPMtSs7HM+TLHLgt5x9lCGxVoHU='
WHERE
key_id = '1ff0946905740ef76c55dfd9a985bdc3c099d34a3f790ab3e6f65c543bab9b1d'
AND (
token = 'VfCHziQS89KQ9ypPRPMtSs7HM+TLHLgt5x9lCGxVoHU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)