UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nHo0kBOx1KjmllNJPPGGfjrkhHgTOLPiLyBmrirzcsg=' 
WHERE 
  key_id = '06a2f8d8a0f1bdebcd946b66600a71cfd66e0bcb0e2481a2e64bcc37db0b2280' 
  AND (
    token = 'nHo0kBOx1KjmllNJPPGGfjrkhHgTOLPiLyBmrirzcsg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034