UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KebxNisgzZAgG8Qsoo6wDJRRXvhzPrVPO0e8TmJSiX4=' 
WHERE 
  key_id = '6deaa980b15ecce787e824903bcd5eced5bfd0950077ffd6c5612f1559cced6b' 
  AND (
    token = 'KebxNisgzZAgG8Qsoo6wDJRRXvhzPrVPO0e8TmJSiX4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019