UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JCDD4/e6yUwcAyAWYVKolXEuLhLEP4x1p4HSmvG94JY='
WHERE
key_id = '14db529ca916d36b2c639999316079ccbfee14aedad4ab7f0e0c8b3931930bbe'
AND (
token = 'JCDD4/e6yUwcAyAWYVKolXEuLhLEP4x1p4HSmvG94JY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)