UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fy1fIHSeAMKrBedsRSpTIMGxYHEH65pN2K42rU1f94A=' 
WHERE 
  key_id = '727185f679e1f7bc8a79ae3607151b20387579edae640478d6785a540e991568' 
  AND (
    token = 'fy1fIHSeAMKrBedsRSpTIMGxYHEH65pN2K42rU1f94A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027