UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's1B4wQt5Bf+pU5ML0WkPEqEWFBhj75hdZa5TpyetSCI=' 
WHERE 
  key_id = '3783d337754f41137b47044f02d10c8f5ac51b4bff3690e50db85198fa9da927' 
  AND (
    token = 's1B4wQt5Bf+pU5ML0WkPEqEWFBhj75hdZa5TpyetSCI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058