UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+vwNIh3yc14jgbq4BozC3e89hOJ2Dncn3ZHUXFx1MYc=' 
WHERE 
  key_id = '13e882777ba81a2d1d5a7eb4402997f9a45e10a9af8203955cfc285a6f28bcb2' 
  AND (
    token = '+vwNIh3yc14jgbq4BozC3e89hOJ2Dncn3ZHUXFx1MYc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032