UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6hsVLeLSib340FRt/Y03EF90VhM6WLA5LTaD+SKKu5A=' 
WHERE 
  key_id = 'c9c158bd3d31ab20803780204d34826c58d51ee17c32c5caf5f0fbaff6c7b03d' 
  AND (
    token = '6hsVLeLSib340FRt/Y03EF90VhM6WLA5LTaD+SKKu5A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028