UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'urFLxamfI4WmpJpy+wjMFH27bac0oH6+1i5fNkdQobY=' 
WHERE 
  key_id = 'e626766a4deba2f1bea4a0d03e3ce6230b788e54b4b650fdf133c45a3fc470d4' 
  AND (
    token = 'urFLxamfI4WmpJpy+wjMFH27bac0oH6+1i5fNkdQobY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029