UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CwFs8nFQfYOGrvjtXFPctywXYkClW5LZQyVWOSQWW+A='
WHERE
key_id = '92f24b8adcb751ed03bceac959407f50026fa6201681de5144253ec501bf8a92'
AND (
token = 'CwFs8nFQfYOGrvjtXFPctywXYkClW5LZQyVWOSQWW+A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)