UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8+UiQEdCqPiF1sIb7foizbWo373kkdyBeI7RgP+ofPI=' 
WHERE 
  key_id = '33177d03c7add03aec0f9c7a4b0ae27e89d2750aa2720acd4043839d53035d0a' 
  AND (
    token = '8+UiQEdCqPiF1sIb7foizbWo373kkdyBeI7RgP+ofPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024