UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'woXJQDvqV0nzyfEiaKcMXAsE2pz28pIJ+2JKU0/hvdk=' 
WHERE 
  key_id = '77065c1fac7868e69592146ea481caa647f9fc2c27378eea2bcfb341274930db' 
  AND (
    token = 'woXJQDvqV0nzyfEiaKcMXAsE2pz28pIJ+2JKU0/hvdk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031