UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yfCvddxR2xO/7AkGY+Z1eeRuSp05Kk3XsD8sj4aP0bA=' 
WHERE 
  key_id = 'bf136f58bba4caec693a78a2fc175312ec2852f4a091944b98e837faa2736c18' 
  AND (
    token = 'yfCvddxR2xO/7AkGY+Z1eeRuSp05Kk3XsD8sj4aP0bA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027